package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Tel      string `gorm:"type:char(11)"`
	Password string `gorm:"type:varchar(32)"`
}
type News struct {
	gorm.Model
	Title   string `gorm:"type:varchar(30)"`
	Content string `gorm:"type:varchar(30)"`
	Img     string `gorm:"type:varchar(30)"`
}
type Like struct {
	gorm.Model
	UserID int  `gorm:"type:int"`
	User   User `gorm:"foreignKey:UserID"`
	NewsID int  `gorm:"type:int"`
	News   News `gorm:"foreignKey:NewsID"`
}
type Collection struct {
	gorm.Model
	UserID int  `gorm:"type:int"`
	User   User `gorm:"foreignKey:UserID"`
	NewsID int  `gorm:"type:int"`
	News   News `gorm:"foreignKey:NewsID"`
}
